﻿<!DOCTYPE HTML>
<html>
<head>
   <title>CheckCode method<br/>
function TOgCodeBase.CheckCode(Report : Boolean) : TCodeStatus; virtual; abstract;<br/>
TCodeStatus = (ogValidCode, ogInvalidCode, ogPastEndDate, ogDayCountUsed, ogRunCountUsed, ogNetCountUsed, ogCodeExpired);</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1, minimum-scale=1" />
   <meta name="generator" content="Help &amp; Manual" />
   <meta name="keywords" content="CheckCode" />
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <meta http-equiv="content-language" content="en-us" />
   <meta name="description" content="CheckCode checks for a valid release code. &nbsp;CheckCode is defined as virtual and abstract, which means that each descendant component overrides it to provide the necessary code t" />
   <meta http-equiv="Content-Style-Type" content="text/css" />
   <link type="text/css" href="default.css" rel="stylesheet" />
   <link id="tabscheme" type="text/css" href="hm_topic.css" rel="stylesheet" />   
<style type="text/css">
/* No header topics */

/* Breadcrumb trail */
p#breadcrumbs {
font-family: Verdana, Tahoma, Helvetica, Sans-Serif;   padding: 2px 0 1px 2px;
   margin: 0;
   font-size: 8pt; 
   color: #999;
   }   
p#breadcrumbs a { color: #999; text-decoration: none;}
p#breadcrumbs a:visited {color: #999;}
p#breadcrumbs a:hover { color: #333; border-bottom: 1px dotted #333; }

/* Search hightlight color */
span.highlight {background-color: #ffff40;}
</style>
<script type="text/javascript">
var hmHeaderTopic = true;

</script> 
<!--[if IE 9]>
<link id="iesvgcss" rel="stylesheet" type="text/css" href="hm_webhelp_svg.css" />
<![endif]-->	
<script src="jquery.js"></script>
<script type="text/javascript" src="jquery.tools.min.js"></script>
<script type="text/javascript" src="jquery.scrollTo-min.js"></script>
<script type="text/javascript"> 
// General topic variables
var tVars = {
   hmHelpPage: "index.html",
   nextP: "",
   prevP: "",
   currP: "togcodebase_checkcode.html",
   descr: "CheckCode checks for a valid release code. &nbsp;CheckCode is defined as virtual and abstract, which means that each descendant component overrides it to provide the necessary code t",
   keys: "CheckCode",
   defP: "onguard_contents.html",
   mailUrl: "",
   mailUrlQuery: "",
   projectTitle: "OnGuard Help",
   titleP: "CheckCode method<br/>
function TOgCodeBase.CheckCode(Report : Boolean) : TCodeStatus; virtual; abstract;<br/>
TCodeStatus = (ogValidCode, ogInvalidCode, ogPastEndDate, ogDayCountUsed, ogRunCountUsed, ogNetCountUsed, ogCodeExpired);",
   mailsubject: "Feedback on: OnGuard Help - CheckCode method function TOgCodeBase.CheckCode(Report : Boolean) : TCodeStatus; virtual; abstract; TCodeStatus = (ogValidCode, ogInvalidCode, ogPastEndDate, ogDayCountUsed, ogRunCountUsed, ogNetCountUsed, ogCodeExpired);",
   sharesubject: "OnGuard Help - CheckCode method function TOgCodeBase.CheckCode(Report : Boolean) : TCodeStatus; virtual; abstract; TCodeStatus = (ogValidCode, ogInvalidCode, ogPastEndDate, ogDayCountUsed, ogRunCountUsed, ogNetCountUsed, ogCodeExpired);",
   simplesubject: "Documentation%20Feedback",
   mailid: "TOgCodeBase.CheckCode",
   mailpath: "Files &gt; OgReg /",
   mailbody: "Dear Support Staff,",
   fbtype: false,
   header: true,
   background: "spacer.gif",
   tablesReady: false,
   togglesReady: false,
   webRedirect: true,
   topicTitleBar: true,
   titleBarContent: "topic",
   printFooter: true,
   zoomTip: "Click to view full size image",
   autoPrint: true,
   printButton: "Print",
   printButtonTip: "Print the current topic"
   }
// Popup configuration
 var hmpBShadow = true;
 var hmPopSmallDim = 500;
 var hmPopKillVideo = true;
 // AutoTOC variables
 var hmatocvars = {
   atoc_show: true,
   atoc_title: "Contents",
   atoc_tip: "Jump to:&nbsp;",
   atoc_minHeaders: 3,
   atoc_btntip_off: "No contents entries on this page",
   atoc_btntip_on: "Display/hide topic directory",
   atoc_toptip: "Jump to top of page",
   atoc_top: "Scroll to Top of Page",
   atoc_bg: "#f6f6f6",
   atoc_border: "silver",
   atoc_linkcolor: "#444",
   atoc_linklimit: 45,
   atoc_hovercolor: "#000",
   atoc_hoverbgcolor: "#e0e0e0"
}
// Sortable tables
var sortVars = {
   europeandate: false,
   germanNumbers: false,
   imagePath: "",
   image_up: "arrow-up.gif",
   image_down: "arrow-down.gif",
   image_empty: "arrow-empty.gif",
   image_none: "arrow-none.gif",
   sort_tip: "Click to sort on this column",
   umlauts: "false"
   }

</script>


<script type="text/javascript" src="helpman_settings.js"></script>
<script type="text/javascript" src="helpman_topicinit.js"></script>
<script type="text/javascript" src="hmtopic.js"></script>

   <script type="text/javascript">
     HMSyncTOC("index.html", "togcodebase_checkcode.html");
   </script>
   <script type="text/javascript" src="highlight.js"></script>
   <script type="text/javascript">
     $(document).ready(function(){highlight();});
   </script>
</head>
<body>
<!-- Help & Manual Premium Pack templates by Tim Green, Copyright (c) 2011-2013, All Rights Reserved -->
<!--ZOOMSTOP-->



<ul id="topictabs" class="tabs">
<li id="indextab" class="hmtabs"><a href="#" id="indextablink" class="current"><span>CheckCode method<br/>
function TOgCodeBase.CheckCode(Report : Boolean) : TCodeStatus; virtual; abstract;<br/>
TCodeStatus = (ogValidCode, ogInvalidCode, ogPastEndDate, ogDayCountUsed, ogRunCountUsed, ogNetCountUsed, ogCodeExpired);</span></a></li>
</ul>
<div id="hmbox">
<div id="hmheader">
<div id="hmheadercontents">
<p id="breadcrumbs" class="sync-toc">
<b><span class="sync-toc"><a rel="nofollow" class="sync-toc-link" href="index.html?togcodebase_checkcode.html" target="_top">&lt;&lt;&nbsp;Click here to display Table of Contents&nbsp;&gt;&gt;</a>&nbsp;&nbsp;</span></b></p> 
<p style="margin: 0px 0px 8px 0px;"><span style="font-size: 12pt; font-weight: bold; color: #0000ff;">CheckCode method</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="font-weight: bold; color: #010100;">function</span><span style="color: #010100;"> <a href="togcodebase_class.html" class="topiclink">TOgCodeBase</a>.CheckCode(Report : Boolean) : TCodeStatus; </span><span style="font-weight: bold; color: #010100;">virtual</span><span style="color: #010100;">; </span><span style="font-weight: bold; color: #010100;">abstract</span><span style="color: #010100;">;</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">TCodeStatus = (ogValidCode, ogInvalidCode, ogPastEndDate, ogDayCountUsed, ogRunCountUsed, ogNetCountUsed, ogCodeExpired);</span></p>

</div>
<div id="atocIcon" class="navdivs">
<img class="navicon" id="hmAtocLink" src="contents_off.png" alt="No contents entries on this page" title="No contents entries on this page" />
<br /><span>Contents</span>
</div>
</div>
<div id="autoTocWrapper" class="topicmenu"></div>
<div id="idcontent">
<div id="unclicker"></div>
<!--ZOOMRESTART-->
<p style="margin: 8px 0px 8px 0px;"><img src="_bm1.png" width="11" height="12" alt="_bm1" style="border:none" /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #010100;">CheckCode checks for a valid release code. </span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">CheckCode is defined as virtual and abstract, which means that each descendant component overrides it to provide the necessary code to validate and test the release code obtained through the Code property. If Report is True, the result of the test is reported by triggering the <a href="togcodebase_onchecked.html" class="topiclink">OnChecked</a> event. If Report is False, you must check the function result. </span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">CheckCode requires several pieces of information, which it obtains by triggering event handlers that you define. The normal sequence of events performed by CheckCode is:</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">1. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Trigger the <a href="togcodebase_ongetkey.html" class="topiclink">OnGetKey</a> event to get the key used to encode and decode the release code. The key should always be embedded in the application as a constant.</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">2. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Trigger the <a href="togcodebase_ongetcode.html" class="topiclink">OnGetCode</a> event to get the release code. The release code is normally stored in the registry or an INI file.</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">3. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Trigger the <a href="togcodebase_ongetmodifier.html" class="topiclink">OnGetModifier</a> event to get the key modifier. The modifier can be stored as a constant in the application, stored in the registry or INI file, or generated when it is needed.</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">4. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Apply the modifier to the key.</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">5. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Test the release code to see if it is valid.</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">6. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Test the release code to see if it has expired. The details of this test depend on the type of release code.</span></p>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">The result of calling CheckCode is one of the following values:</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 1px;"><table style="border:none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p><span style="font-size: 8pt; color: #010100;">ogValidCode</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">release code is valid.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p><span style="font-size: 8pt; color: #010100;">ogInvalidCode</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">release code is invalid (the internal integrity check failed).</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p><span style="font-size: 8pt; color: #010100;">ogPastEndDate</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">ending date has past.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p><span style="font-size: 8pt; color: #010100;">ogDayCountUsed</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">authorized days have been used.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p><span style="font-size: 8pt; color: #010100;">ogRunCountUsed</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">authorized runs have been used.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p><span style="font-size: 8pt; color: #010100;">ogNetCountUsed</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">number of authorized users has been exceeded.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td style="vertical-align:top; width:93px; padding:0px;"><p style="margin: 0px 0px 11px 0px;"><span style="font-size: 8pt; color: #010100;">ogCodeExpired</span></p>
</td>
<td style="vertical-align:top; width:341px; padding:0px;"><p style="margin: 0px 0px 11px 0px;"><span style="width:48px">&nbsp;</span><span style="font-size: 8pt; color: #010100;">The expiration date has been reached.</span></p>
</td>
</tr>
</table>
</div>
<p style="margin: 0px 0px 8px 0px;"><span style="color: #010100;">See also: <a href="togcodebase_autocheck.html" class="topiclink">AutoCheck</a>, <a href="togcodebase_onchecked.html" class="topiclink">OnChecked</a>, <a href="togcodebase_ongetcode.html" class="topiclink">OnGetCode</a>, <a href="togcodebase_ongetkey.html" class="topiclink">OnGetKey</a>, <a href="togcodebase_ongetmodifier.html" class="topiclink">OnGetModifier</a></span></p>

<!--ZOOMSTOP-->


</div> <!-- idcontent -->
</div><!-- hmbox --> 
</body>
</html>
